package org.jeecg.modules.business.outbound.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.business.outbound.entity.WmsOutReceiptTaskMaterial;
import org.jeecg.modules.business.outbound.entity.WmsOutReceiptTaskMaterialExport;
import org.jeecg.modules.business.outbound.entity.dto.WmsOutReceiptTaskDTO;
import org.jeecg.modules.business.outbound.mapper.WmsOutReceiptTaskMaterialMapper;
import org.jeecg.modules.business.outbound.service.IWmsOutReceiptTaskMaterialService;
import org.jeecg.modules.business.outbound.vo.WmsOutReceiptTaskMaterialResponseVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 出库任务-物料
 * @Author: jeecg-boot
 * @Date:   2023-08-09
 * @Version: V1.0
 */
@Service
public class WmsOutReceiptTaskMaterialServiceImpl extends ServiceImpl<WmsOutReceiptTaskMaterialMapper, WmsOutReceiptTaskMaterial> implements IWmsOutReceiptTaskMaterialService {

	@Resource
	private WmsOutReceiptTaskMaterialMapper wmsOutReceiptTaskMaterialMapper;

	@Override
	public List<WmsOutReceiptTaskMaterial> selectByMainId(String mainId) {
		return wmsOutReceiptTaskMaterialMapper.selectByMainId(mainId);
	}

	/**
	 * 出库任务-物料主表ID分页查询
	 * @param page
	 * @param id
	 * @param name
	 * @param deviceType
	 * @return
	 */
    @Override
    public IPage<WmsOutReceiptTaskMaterialResponseVO> queryPageTaskMaterialByTaskId(IPage<WmsOutReceiptTaskMaterial> page, String id, String name, String deviceType,Integer unCompleted) {
		IPage<WmsOutReceiptTaskMaterialResponseVO> pageList=wmsOutReceiptTaskMaterialMapper.queryPageTaskMaterialByTaskId(page,id,name,deviceType,unCompleted);
		return pageList;
    }

	/**
	 * 不分页查物料明细
	 *
	 * @param wmsOutReceiptTaskDTO
	 * @return java.util.List<org.jeecg.modules.business.outbound.entity.WmsOutReceiptTaskMaterial>
	 * @author DuSongyao
	 * @since 2024/1/8 19:34
	 */
	@Override
	public List<WmsOutReceiptTaskMaterialExport> listOutMaterialExportByTask(WmsOutReceiptTaskDTO wmsOutReceiptTaskDTO) {
		return wmsOutReceiptTaskMaterialMapper.listOutMaterialExportByTask(wmsOutReceiptTaskDTO);
	}

	/**
	 * 通过任务id查询出库任务物料信息带灯信息
	 * @param id
	 * @return
	 */
    @Override
    public List<WmsOutReceiptTaskMaterialResponseVO> getListByTaskIdWithLight(String id,String code,Boolean unCompleted,String batchCode) {
		return wmsOutReceiptTaskMaterialMapper.getListByTaskIdWithLight(id,code,unCompleted,batchCode);
    }
}
